import numpy as np

x = np.array([[1.2, 1.5, 1.8],
             [1.3, 1.4, 1.9],
             [1.1, 1.6, 1.7]])

y = np.array([5, 10, 9])



print('*'*15,'使用循环方式计算','*'*15)
price_total = [0,0,0]
i = 0   # 用于遍历日期
for price_single_day in x:
    j = 0   # 用于遍历各种菜的价格
    for number in y:
        price_total[i] = price_single_day[j] * number + price_total[i]
        j = j + 1
    i = i +1
print(price_total,'\n')

print('*'*15,'使用矩阵点乘方式计算','*'*15)
Z = np.dot(x,y)
print(Z)